<?php 
define('Copyright', '作者QQ:1834219632');
define('ROOT_PATH', $_SERVER["DOCUMENT_ROOT"].'/');
include_once ROOT_PATH.'function/cheCookie.php';
include_once ROOT_PATH.'function/global.php';

$name = base64_decode($_COOKIE['g_user']);


$db=new DB();
$sql = "SELECT * FROM g_zhudan where g_nid='$name' ORDER BY g_id DESC LIMIT 10";
$result1 = $db->query($sql, 1);

 $configModel = configModel("g_kg_game_lock,g_cq_game_lock,g_gx_game_lock,g_pk_game_lock,g_nc_game_lock,g_lhc_game_lock,g_xj_game_lock,g_jsk3_game_lock");
		 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" oncontextmenu="return false">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/left.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/sc.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<style type="text/css">
body {
    background-color: #260707;
    font-size: 12px;
    font-family:"微软雅黑";
    height: 100%;
}
.mains {
   width: 240px;
   height: 220px;
   background-color: #7C5329;
   position: relative;
   font-family:"微软雅黑";
}
.accountInfo {
    width: 220px;
    margin-left: 13px;
    position: absolute;
	font-family:"微软雅黑";
}
.accountInfo table {
    border-collapse :collapse ;
    margin-top: 20px;
	font-family:"微软雅黑";
}
.accountInfo td{
    height: 22px;
    border :1px solid #520505;
    font-size:12px;
    text-align :center;
    background-color: #634221;
    color: #ffc49d;
    font-family:"微软雅黑";
}
.main-nav a {
    display: inline-block;
    line-height: 20px;
    width: 5em;
    text-align: center;
    text-decoration: none;
	font-family:"微软雅黑";
}
.main-nav span{
	position: relative;
    top:130px;
    left:25px;
	border-right: 1px solid #edd0bd;
	font-family:"微软雅黑";
}
.main-nav span a {
    color:#edd0bd;
    text-decoration: none;
    font-family:"微软雅黑";
}
.main-nav span a:hover {
    color:#FFD800;
	font-family:"微软雅黑";
}
.loginout {
	width: 100px;
	height: 27px;
    margin:0 auto;
    position: relative;
    top:190px;
    background: url(/pagef/bgcon.png) no-repeat 0 -21px;;
	font-family:"微软雅黑";
}
.loginout:hover {
    background: url(/pagef/bgcon.png) no-repeat -110px -21px;;
}
.navs {
	width: 216px;
	height: 257px;
	font-family:"微软雅黑";
}
.t_list {
	background-color:white;
    position: relative;
	font-family:"微软雅黑";
}
.t_list {
	border-collapse :collapse ;
	font-family:"微软雅黑";
    text-align: center;
}
.t_list tr td {
   width:50px; 
   height: 30px;
   font-size:12px;
   color: #E2983B;
   font-family:"微软雅黑";
   border: 1px solid #260707;
}
td .list{
	width: 100px;
	color:#3B2D1B;  
	font-family:"微软雅黑";
}
td .refresh {
	color:#ffd5a0; 
	text-align: center;
	font-family:"微软雅黑";
}
.refresh button{
	background-color: #925E20; 
	border: 1px solid #755227;
	padding: 2px;
	border-radius:2px;
	margin-top: 2px;
	font-family:"微软雅黑";
}
.refresh button a:hover {
	color:yellow; 
	font-family:"微软雅黑";
}
.t_list tr:nth-child(1){
	background: url(/pagef/resh_tit.png);
}
.t_list tr:nth-child(2){
	border :1px solid #520505;
	background-color: #331C00;
	text-align: center;
}
.reward {
    width: 214px;
	height:125px;
	background-color: white;
	position: relative;
	left:12px;
	top:15px;
	font-weight: bold;
	font-family:"微软雅黑";
}
.reward table {
	border-collapse :collapse ;
	font-family:"微软雅黑";
}
.reward table tr:nth-child(1) {
	background :url(/pagef/kaijianwang_tit.png);
	color: white;
	position: relative;
	z-index: 3;
	font-family:"微软雅黑";
}
.reward table tr:nth-child(2),.reward table tr:nth-child(3),.reward table tr:nth-child(4), .reward table tr:nth-child(5){
     background: url(/pagef/kaijianwang_tdbg.png) repeat-x;
}
.reward tr td {
  width: 106px;
  height: 24px;
  border: 1px solid #DDD8D5;
  font-size:12px;
  text-align :center;
  color: #4A1A04;
  font-family:"微软雅黑";
}
</style>
</head>
<script>
	/*
function getinfo()
	{
		$.ajax({
			type : "POST",
			url : '/function/Refresh.php',
			error : function(XMLHttpRequest, textStatus, errorThrown){
				if (XMLHttpRequest.readyState == 4){
					if (XMLHttpRequest.status == 500){
						getinfo();
						return false;
					}
				}
			},
			success:function(data){
				var datestr=data.split(';');
				$("#pls").html(datestr[0]);
				$("#xinyong").html(datestr[1]);
				$("#jine").html(datestr[2]);
				$("#tentable").html(datestr[3]);
			}
		});
	}
setInterval(getinfo, 5000);
*/
function getinfo2()
	{
		$.ajax({
			type : "POST",
			url : '/function/getmine.php',
			error : function(XMLHttpRequest, textStatus, errorThrown){
				if (XMLHttpRequest.readyState == 4){
					if (XMLHttpRequest.status == 500){
						getinfo2();
						return false;
					}
				}
			},
			success:function(data){
				var datestr=data.split(';');
				$("#xinyong").html(datestr[0]);
				$("#jine").html(datestr[1]);
			}
		});
	}
setInterval(getinfo2, 20000);
</script> 
<body>
  <div class="mains">
	  <div class="accountInfo">	
		<table cellspacing="0">
			<tr style="height: 33px">
				<td width="84px">賬號:</td>
				<td width="125px"><?php echo $user[0]['g_name']?><span id="pls" style="color:red">&nbsp;(&nbsp;<?php echo strtoupper($user[0]['g_panlus'])?>盤&nbsp;)</span>
				</td>
			</tr>
			<tr>
				<td>信用额度:</td>
				<td><?php echo $user[0]['g_money']?></td>
			</tr>
			<tr>
				<td>信用余额:</td>
				<td><?php echo $user[0]['g_money_yes']?>&nbsp;<span colspan="2" class="refresh" style="color:white;border: none;height: 20px;font-size: 10px;"><button><a href="javascript:void(0)" onclick="window.location.reload()">刷新</a></button></span></td>
			</tr>
			 <tr>
				<td>已下金额:</td>
				<td>
			<?php
			   $db=new DB();
				$sqls = "SELECT sum(g_jiner) as jiners FROM g_zhudan where g_nid='$name' ORDER BY g_id DESC";
				$results= $db->query($sqls, 1);
				foreach ($results as $key => $value) {
					if($value[jiners]){

					  echo $value[jiners];
					}else{
						echo 0;
					}
				}
				?>
			</td>
			</tr> 
		</table>
	  </div>
	  <div class="main-nav">
	  	 <p style="width: 210px;margin:auto 0;float: left;">
	  	 	<span>
	  	 		<a nav="status" href="report.php" title="" target="mainFrame">下注狀況</a>
	  	 	</span>
	  	 	<span>
	  	 		<a nav="status" href="repore.php" title="" target="mainFrame">賬戶歷史</a>
	  	 	</span>
	  	 	<span>
	  	 		<a nav="status" href="result.php" title="" target="mainFrame">開獎結果</a>
	  	 	</span>
	  	 	<span>
	  	 		<a nav="status" href="topMenu.php" title="" target="mainFrame">個人資訊</a>
	  	 	</span>
	  	 	<span>
	  	 		<a nav="status" href="/templates_r/rule.html" title="" target="mainFrame">遊戲規則</a>
	  	 	</span>
	  	 	<span>
	  	 		<a nav="status" href="upPwd.php" title="" target="mainFrame">修改密碼</a>
	  	 	</span>
	  	 	<span style="border-right: none">
	  	 		<a nav="status" href="javascript:void(0)" title="">線路選擇</a>
	  	 	</span>
	  	 </p>
	  </div>
	  <a nav="status" href="quit.php" target="mainFrame"><div class="loginout"></div></a>
	  <!--  onclick="window.location.href='quit.php'" -->
  </div>
  <div class="navs">
       <div class="reward">
            <table>
                  <tr>
                    <td colspan="2" style="color:white">开奖網站導航</td>
                  </tr>
                  <tr>
                    <td><a href="http://kl10.icaile.com/" target="_blank">广东快乐十分</a></td>
                    <td><a href="http://kaijiang.aicai.com/cqssc/" target="_blank">重庆时时彩</a></td>
                  </tr>
                  <tr>
                    <td><a href="http://www.bwlc.net/buy/trax/" target="_blank">北京赛车</a></td>
                    <td><a href="http://www.16cp.com/gamedraw/lucky/open.shtml" target="_blank">幸运农场</a></td>
                  </tr>
                  <tr>
                    <td><a href="http://98vp.com/Jssb" target="_blank">江蘇骰宝</a></td>
                    <td><a href="http://www.bwlc.net/bulletin/index.jsp" target="_blank">快乐8-北京</a></td>
                  </tr>
                  <tr>
                    <td><a href="https://www.caipiaokong.com/lottery/jndklb.html" target="_blank">快乐8-加拿大</a></td>
                    <td><a href="" target="_blank"></a></td>
                  </tr>    
            </table>
        </div>  
<!-- 	  	<table cellspacing="0">
	  		<tr>
	  			<td colspan="2" class="list" style="color:#3B2D1B;font-weight: bold;">最新注单</td>
	  			<td colspan="2" class="refresh"><button><a href="javascript:void(0)" onclick="window.location.reload()">刷新</a></button></td>
	  		</tr>
	  		<tr>
	  			<td>號碼</td>
	  			<td>赔率</td>
	  			<td>金額</td>
	  			<td>時間</td>
	  		</tr>
	  	</table> -->
        <table border="0" cellpadding="0" cellspacing="1" class="t_list"  width="216" style="margin-top: 30px;margin-left: 12px" id="tentable">
           <tr>
                <td colspan="2" class="list" style="color:#3B2D1B;font-weight: bold;border: none">最新注单</td>
                <td colspan="2" class="refresh" style="bold;border: none""><button><a href="javascript:void(0)" onclick="window.location.reload()">刷新</a></button></td>
            </tr>
            <tr>
                <td style="width: 60px;">號碼</td>
                <td style="width: 50px;">赔率</td>
                <td style="width: 45px;">金額</td>
                <td style="width: 60px;">時間</td>
            </tr>
<?php for($i=0;$i<count($result1);$i++){
$SumNum = sumCountMoney ($user, $result1[$i], true);
        if ($result1[$i]['g_mingxi_1_str'] == null) {
            if ($result1[$i]['g_mingxi_1'] == '總和、龍虎' || $result1[$i]['g_mingxi_1'] == '總和、龍虎和'){
                $n = $result1[$i]['g_mingxi_2'];
            }else {
                $n = $result1[$i]['g_mingxi_1'].'『'.$result1[$i]['g_mingxi_2'].'』';
            }
            //$n = $result[$i]['g_mingxi_1'] == '總和、龍虎' ? $result[$i]['g_mingxi_2'] : $result[$i]['g_mingxi_1'].'『'.$result[$i]['g_mingxi_2'].'』';
            $html = '<font color="#0066FF">'.$n.'</font>';
        } else {
            $_xMoney = $result1[$i]['g_mingxi_1_str'] * $result1[$i]['g_jiner'];
            $SumNum['Money'] = '<font color="#009933">'.$result1[$i]['g_mingxi_1_str'].'</font> x <font color="#0066FF">'.$result1[$i]['g_jiner'].'</font><br />'.$_xMoney;
            $html = '<font color="#0066FF">'.$result1[$i]['g_mingxi_1'].'</font><br />'.
                        '<span style="line-height:23px">復式  『 '.$result1[$i]['g_mingxi_1_str'].' 組 』</span><br/><span>'.$result1[$i]['g_mingxi_2'].'</span>';
        }

?>
<TR >
<TD ><FONT color=#000000><?php echo $html?></FONT></TD>
<TD><FONT color=#000000><font color="red"><b><?php echo $result1[$i]['g_odds']?></b></font><!-- <?php echo date('H:i:s',strtotime($result1[$i]['g_date']));?> --></FONT></TD>
<TD><FONT color=#000000><?php echo $result1[$i]['g_jiner']?></FONT></TD>
<TD><FONT color=#000000><?php echo date('H:i:s',strtotime($result1[$i]['g_date']));?></FONT></TD></TR>


<?php

}


?>
                </table>
</div>
  </div>
                
</body>
</html>